package ExamLab.Test2;

class TheA extends Thread{
    public void run(){
         synchronized(this){
              for(int i=0; i<10; i++){
                   System.out.print(i+",");
              }
         }
    }
}

class TheB extends TheA{
    public void run(){
         synchronized(this){
              for(int i=0; i<10; i++){
                   System.out.print(i+",");
              }
         }
    }	
}

public class TDemo{
    public static void main(String argv[]){
         TheA ta=new TheA();
         TheB tb=new TheB();
         ta.start();
         tb.start();
    }
}
